﻿
namespace IMDBServiceAPI
{
    /// <summary>
    /// Static class containing all the string constants used in the project
    /// </summary>
    internal static class IMDBServiceConstants
    {
        // Urls
        internal const string URL_IMDB_FIND = "http://www.imdb.com/find?s=tt&q={0}";
        internal const string URL_IMDB_TITLE = "http://www.imdb.com/title/{0}/";
        // constant
        internal const string IMDB_URL_FIND = "find";
        internal const int URL_TIME_OUT = 30000;
        // regular expressions used
        internal const string EXPR_MOVIE_URL_EXTRACT_MEDIA = @"<b>Media from(?<area>.*)</b>";
        internal const string EXPR_MOVIE_URL_EXTRACT_POPULAR = @"<p><b>Popular Titles</b>(?<area>.*)</table>";
        internal const string EXPR_MOVIE_URL_EXTRACT_EXACT = @"<p><b>Titles\s*\(Exact Matches\)</b>(?<area>.*)</table>";
        internal const string EXPR_MOVIE_URL_EXTRACT_PARTIAL = @"<p><b>Titles\s*\(Partial Matches\)</b>(?<area>.*)</table>";
        internal const string EXPR_MOVIE_URL_EXTRACT_AREA = @"<a href=""/title/(?<url>([\w\d]*))/";
        internal const string EXPR_MOVIE_TITLE = @"<title>(?<title>.*)\((?<year>\d*)\)</title>";
        internal const string EXPR_MOVIE_RATING = @"<div class=""starbar-meta"">\s*<b>(?<rating>[\d\.]*)/(.*)</b>";
        internal const string EXPR_MOVIE_GENRE_LIST = @"<h5>Genre:</h5>\s*<div class=""info-content"">\s*(?<area>.*)\s*</div>";
        internal const string EXPR_MOVIE_GENRE = @"<a href=""/Sections/Genres/(?<genre>\w*)/";
        // key for expression groups
        internal const string EXPR_GROUP_URL = "url";
        internal const string EXPR_GROUP_AREA = "area";
        internal const string EXPR_GROUP_GENRE = "genre";
        internal const string EXPR_GROUP_TITLE = "title";
        internal const string EXPR_GROUP_YEAR = "year";
        internal const string EXPR_GROUP_RATING = "rating";
        // formats
        internal const string FORMAT_GENRE_LIST = "{0};";
        internal const string FORMAT_EXCEPTION_MESSAGE = "Unable to retrieve file information for \"{0}\"";


    }
}





